﻿<?xml version="1.0" encoding="utf-8" ?>

<scope xmlns="http://metalx.org/Program" xmlns:cpu="http://metalx.org/Mos/65816/Operators">
	<!--Disable Interrupts-->
	<cpu:SetInterruptDisableFlag/>
	
	<!--Switch To Native Mode-->
	<cpu:ClearCarryFlag/>
	<cpu:ExchangeCarryFlagWithEmulationFlag/>
	
	<!--Disable Decimal Mode / Switch To 16-Bit-->
	<cpu:ClearImmediateFlags/>
	<binary>00011000</binary>
	
	<!--Setup Stack Pointer-->
	<cpu:CopyImmediateToXIndex/>
	<hex>1fff</hex>

	<cpu:CopyXIndexToStackPointer/>
	
	<!--Switch To 8-Bit-->
	<cpu:SetImmediateFlags/>
	<binary>00110000</binary>

	<!--Setup Display-->
	<cpu:CopyImmediateToAccumulator/>
	<binary>10001111</binary>

	<cpu:CopyAccumulatorToAbsoluteAddress/>
	<hex>2100</hex>
	
	<!--Setup Sprites-->
	<cpu:SetAbsoluteAddressToZero/>
	<hex>2101</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>2102</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>2103</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>2105</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>2106</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>2107</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>2108</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>2109</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>210a</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>210b</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>210c</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>210d</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>210d</hex>

	<!--Setup Scroll Y Positions-->
	<cpu:CopyImmediateToAccumulator/>
	<hex>ff</hex>

	<cpu:CopyAccumulatorToAbsoluteAddress/>
	<hex>210e</hex>

	<cpu:CopyAccumulatorToAbsoluteAddress/>
	<hex>2110</hex>

	<cpu:CopyAccumulatorToAbsoluteAddress/>
	<hex>2112</hex>

	<cpu:CopyAccumulatorToAbsoluteAddress/>
	<hex>2114</hex>

	<cpu:CopyImmediateToAccumulator/>
	<hex>07</hex>

	<cpu:CopyAccumulatorToAbsoluteAddress/>
	<hex>210e</hex>

	<cpu:CopyAccumulatorToAbsoluteAddress/>
	<hex>2110</hex>

	<cpu:CopyAccumulatorToAbsoluteAddress/>
	<hex>2112</hex>

	<cpu:CopyAccumulatorToAbsoluteAddress/>
	<hex>2114</hex>

	<!--Setup Scroll X Positions-->

	<cpu:SetAbsoluteAddressToZero/>
	<hex>210f</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>210f</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>2111</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>2111</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>2113</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>2113</hex>
	
	<!--Setup Video RAM-->
	<cpu:CopyImmediateToAccumulator/>
	<hex>80</hex>

	<cpu:CopyAccumulatorToAbsoluteAddress/>
	<hex>2115</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>2116</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>2117</hex>

	<!--Setup Mode 7-->
	<cpu:SetAbsoluteAddressToZero/>
	<hex>211a</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>211b</hex>

	<cpu:CopyImmediateToAccumulator/>
	<hex>01</hex>

	<cpu:CopyAccumulatorToAbsoluteAddress/>
	<hex>211b</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>211c</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>211c</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>211d</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>211d</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>211e</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>211e</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>211f</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>211f</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>2120</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>2120</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>2121</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>2123</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>2124</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>2125</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>2126</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>2127</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>2128</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>2129</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>212a</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>212b</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>212c</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>212d</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>212e</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>212f</hex>

	<cpu:CopyImmediateToAccumulator/>
	<hex>30</hex>

	<cpu:CopyAccumulatorToAbsoluteAddress/>
	<hex>2130</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>2131</hex>

	<cpu:CopyImmediateToAccumulator/>
	<hex>e0</hex>

	<cpu:CopyAccumulatorToAbsoluteAddress/>
	<hex>2132</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>2133</hex>
	
	<!--Setup Interrupts-->
	<cpu:SetAbsoluteAddressToZero/>
	<hex>4200</hex>

	<cpu:CopyImmediateToAccumulator/>
	<hex>ff</hex>

	<cpu:CopyAccumulatorToAbsoluteAddress/>
	<hex>4201</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>4202</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>4203</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>4204</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>4205</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>4206</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>4207</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>4208</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>4209</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>420a</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>420b</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>420c</hex>

	<cpu:SetAbsoluteAddressToZero/>
	<hex>420d</hex>

	<cpu:ClearInterruptDisableFlag/>
	
	<!--Test Background Color-->
	<cpu:CopyImmediateToAccumulator/>
	<binary>10000000</binary>

	<cpu:CopyAccumulatorToAbsoluteAddress/>
	<hex>2100</hex>

	<cpu:CopyImmediateToAccumulator/>
	<binary>00000000</binary>

	<cpu:CopyAccumulatorToAbsoluteAddress/>
	<hex>2122</hex>

	<cpu:CopyImmediateToAccumulator/>
	<binary>11111000</binary>

	<cpu:CopyAccumulatorToAbsoluteAddress/>
	<hex>2122</hex>

	<cpu:CopyImmediateToAccumulator/>
	<binary>00001111</binary>

	<cpu:CopyAccumulatorToAbsoluteAddress/>
	<hex>2100</hex>

	<cpu:StopProcessor/>
</scope>